package com.aps.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.aps.entity.domain.Store;
import com.aps.entity.dto.PosSyncStore;
import com.aps.service.IStoreService;
import com.aps.service.rep.StoreReq;

/**
 * @author liaoguangan
 * @description <>
 * @date 2018/4/2 18:51
 */
@Service
public class StoreServiceImpl implements IStoreService {

    @Autowired
    private StoreReq storeReq;

    /**
     * 同步门店信息
     *
     * @param posSyncStore
     */
    @Override
    public void save(List<PosSyncStore> posSyncStore) {
        List<Store> stores = new ArrayList<>();
        for (PosSyncStore ps : posSyncStore) {
            stores.add(ps.build());
        }
        storeReq.save(stores);
    }
}
